home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Commo-Support / Disk-Archive / install-2_05.dms / install-2_05.adf / S / SelectMap < prev    next >
Encoding:
AmigaDOS Script File  |  1992-01-09  |  2.5 KB  |  119 lines

  1. .key target
  2. .bra «
  3. .ket »
  4. .def target sys:
  5.  
  6. ; make required commands resident
  7. resident >NIL: c:assign add pure
  8. resident >NIL: c:copy add pure
  9. resident >NIL: c:list add pure
  10. resident >NIL: c:search add pure
  11. resident >NIL: c:type add pure
  12. resident >NIL: c:wait
  13.  
  14. ; copy setmap to ram to avoid a disk swap
  15. copy sys:system/setmap ram: quiet
  16.  
  17. ; build the keymap choice table
  18. failat 21
  19.  
  20. set keysource Extras2.0:
  21. set keytarget «target»
  22. ;
  23. echo "*Ec*N                KeyMap Selection"
  24. echo "*NThis will allow you to choose a keymap for use in the"
  25. echo "installation procedure.  Your Extras disk will be required."
  26. echo "*NDo you wish to continue ? (1 = Yes / 0 = No) " noline
  27. unset query
  28. set >NIL: query ?
  29. if NOT "$query" EQ "1"
  30.     if NOT "$query" EQ "y"
  31.         skip keyexit2
  32.     endif
  33. endif
  34.  
  35. ; devs: will later be assigned to Extras.  we save off the current assign
  36. ; now to avoid a disk swap later.
  37. assign olddevs$process: devs:
  38. ;
  39. if EXISTS ${keysource}devs/keymaps
  40.     list ${keysource}devs/keymaps lformat "%-8n(%c)" >t:key${process}
  41.     type t:key${process} number to t:akey${process}
  42. endif
  43. echo "    0 usa     (American)" >>t:akey${process}
  44.  
  45. lab keystart
  46. ;
  47. echo "*Ec*N                Select KeyMap*N"
  48. ;
  49. unset number
  50. type t:akey${process}
  51. echo "*NYour choice (RETURN to exit without choosing) ? " noline
  52. set >NIL: number ?
  53. ; did they want to just quit ?
  54. if "$number" EQ "*$number"
  55.     skip keyexit1
  56. endif
  57. ;
  58. ; usa keymap is in rom
  59. if "$number" EQ "0"
  60.     setenv sys/keyboard usa
  61.     skip keyend
  62. endif
  63. ;
  64. ; validity check
  65. if "$number" GT "9"
  66.     echo "*NInvalid selection."
  67.     wait 3 sec
  68.     skip back keystart
  69. else
  70.     if "0" GT "$number"
  71.         echo "*NInvalid selection."
  72.         wait 3 sec
  73.         skip back keystart
  74.     endif
  75. endif
  76.  
  77. ;
  78. ; translate the number into the keymap name
  79. ;
  80. set look string="`echo " $number "`"
  81. ; make sure selection number exists in list
  82. search >NIL: t:akey${process} $look
  83. if WARN
  84.     echo "*NInvalid selection."
  85.     wait 3
  86.     skip back keystart
  87. endif
  88.  
  89. echo "`search t:akey${process} $look`" first 14 len 4 >env:sys/keyboard
  90. ;
  91. lab keyend
  92.  
  93. ; set the selected keymap
  94. assign devs: ${keysource}devs
  95. ram:setmap ${sys/keyboard}
  96. assign devs: olddevs$process:
  97.  
  98. ;
  99. lab keyexit1
  100.  
  101. delete >NIL: t:key${process} t:akey${process} quiet
  102.  
  103. lab keyexit2
  104.  
  105. delete >NIL: ram:setmap
  106.  
  107. resident >NIL: remove assign
  108. resident >NIL: remove copy
  109. resident >NIL: remove list
  110. resident >NIL: remove search
  111. resident >NIL: remove type
  112. resident >NIL: remove wait
  113.  
  114. unset query
  115. unset look
  116. unset number
  117. unset keysource
  118. unset keytarget
  119.